﻿#if !MONOGAME

using Brain;
using Brain.Ballistics3D;
using Microsoft.Xna.Framework;

namespace Demos
{
    public class Bullets : DemoScreen
    {
        InputFreeCamera3D Camera;
        public Bullets()
        {
            IRenderManager3D render = Engine.Instance.RenderManager3D;

            //Camera
            Camera = new InputFreeCamera3D(this);
            Camera.AspectRatio = 1280 / 720f;
            Camera.FarPlane = 1000f;
            Engine.Instance.CameraManager.Camera3D = Camera;

            // Make the City
            WorldObject ground = new WorldObject("Game\\Models\\model_box");
            ground.WorldMatrix = Matrix.CreateScale(100, 1, 100);
            render.SubmitWorldObject(ground);

            manager = new BulletManager3D(100);
            DefaultBulletRendererTexture3D renderer = new DefaultBulletRendererTexture3D("Game\\Textures\\snow");
            manager.BulletRenderer = renderer;
        }
        BulletManager3D manager;

        public override void Update()
        {
            base.Update();

            if (Engine.Instance.InputManager.IsMouseLeftClick())
            {
                manager.AddBullet(Camera.Position, Camera.RotationMatrix.Forward, 100, SetBullet);
            }
            manager.Update();
        }
        void SetBullet(Bullet3D bullet)
        {
        }

        public override void Draw()
        {
            base.Draw();

            manager.Draw();
        }
    }
}
#endif